
<?php //echo javascript_include_tag('jquery') ?>

<?php echo stylesheet_tag('menu') ?>




    <ul id="nav">
        <!--Menu home -->
    <li class="submain" id="home" ><a class="asubmain" href="<?php echo url_for('alert/list') ?>"> HOME</a></li>
       <!--Menu SYSTEM -->
    <li class="submain" id="system" ><a class="asubmain" href="#"> SYSTEM</a>
        <?php   if ($sf_user->hasCredential('MANAGE_ADMIN') ){ ?>  
        <ul id="subsystem" >
            <li  >
                <a href="<?php echo url_for('@users');?>"    >Users</a>
            </li>
            <li>
                <a  href="<?php echo url_for('sfGuardPermission/list');?>">Permission</a>
            </li>
            <li>
                <a href="<?php echo url_for('sfGuardGroup/list');?>">Group</a>
            </li>
        </ul>
        <?php }?>
    </li>
       <!--MENU WAREHOUSE-->
    <li class="submain" id="warehouse"><a class="asubmain" href="#" >  WAREHOUSE </a>
      <ul id="subwarehouse" >
            <li><a href="<?php echo url_for('main/showDashboard') ?>">Dash board</a> </li>       
             <?php if ($sf_user->hasCredential('VIEW_CLIENT')) {?>
            <li><a href="<?php echo url_for('client/list') ?>">Client</a></li>
             <?php }?>
             <?php if ($sf_user->hasCredential('VIEW_SUPPLIER')) {?>
            <li><a href="<?php echo url_for('supplier/list') ?>">Supplier</a></li>
             <?php }?>
             <?php if ($sf_user->hasCredential('VIEW_PROJECT')) {?>
            <li><a href="<?php echo url_for('project/list') ?>">Project</a> </li>     
             <?}?>
            <?php if ($sf_user->hasCredential('VIEW_BOM')) {?>
            <li><a href="<?php echo url_for('bom/list') ?>">BOM</a></li>
            <?}?>
            <li><a href="#">MR >></a>
                <ul>
                    <?php if ($sf_user->hasCredential('VIEW_MR')) {?>
                  <li><a href="<?php echo url_for('mr/list') ?>">MR BOM</a></li>
                    <?}?>
                   <?php if ($sf_user->hasCredential('VIEW_MRSUBSTK') || $sf_user->hasCredential('VIEW_MRSUBFTR')) {?>
                  <li><a href="<?php echo url_for('mr2/list') ?>">MR Sub</a> </li>   
                   <?}?>
		   <?php if ($sf_user->hasCredential('VIEW_MRRAW')) {?>     
                  <li><a href="<?php echo url_for('mr3/list') ?>">MR Raw</a></li>
                   <?}?>
             </ul>
            </li>            
            <li><a href="<?php echo url_for('po/list') ?>">PO</a></li>  
            <?php if ($sf_user->hasCredential('CREATE_PO')) {?>
            <li><a href="#">PO Create >></a>
                <ul>            
                 <li>  <a href="<?php echo url_for('po/SLListJobPurchaser?mod=MR') ?>">MR</a> </li> 
                 <li>  <a href="<?php echo url_for('po/SLListJobPurchaser?mod=MR2') ?>">MR Sub</a> </li> 
                 <li>  <a href="<?php echo url_for('po/SLListJobPurchaser?mod=MR3') ?>">MR Raw</a> </li> 
               </ul>
            </li>   
            <?}?> 
             <li><a href="#">Component >></a>
                <ul>
                    <?php if ($sf_user->hasCredential('VIEW_COMP')) {?>
                   <li><a href="<?php echo url_for('component/list') ?>">Component</a></li>
                    <?}?>		       
		   <?php if ($sf_user->hasCredential('VIEW_COMPTYPE')) {?>
                   <li><a href="<?php echo url_for('componenttype/list') ?>">Component Type</a></li>
                     <?}?>		       
		   <?php if ($sf_user->hasCredential('VIEW_COMPUNIT')) {?>
                   <li><a href="<?php echo url_for('componentunit/list') ?>">Component Unit</a> </li>   
                    <?}?>    
               </ul>
            </li>
            <li><a href="#">Store >></a>
                <ul>                  
                   <?php if ($sf_user->hasCredential('VIEW_TALLYIN')) {?>
                    <li><a href="<?php echo url_for('tallyin/list') ?>">Taly In</a></li>
                   <?}?>		       
                   <?php if ($sf_user->hasCredential('VIEW_TALLYOUT')) {?>
                    <li><a href="<?php echo url_for('tallyout/list') ?>">Taly Out</a></li>
                   <?}?>
                    <?php if ($sf_user->hasCredential('VIEW_COMPSBYCLIENT')) {?>
                    <li><a href="<?php echo url_for('componentsbyclient/list') ?>">Component By Client</a> </li>     
                    <?}?>  
                   <?php if ($sf_user->hasCredential('VIEW_PHYSICALQTY')) {?>
                   <li><a href="<?php echo url_for('physicalqty/list') ?>">Physical Qty</a></li>
                  <?}?>
                  <?php if ($sf_user->hasCredential('VIEW_TEMPOUTPUT')) {?>
                   <li><a href="<?php echo url_for('temporaryoutput/list') ?>">Temporary Output</a></li>
                  <?}?>
                   <li><a href="<?php echo url_for('component/ViewWarehouse') ?>">View WareHouse</a></li>                             
                   <?php if ($sf_user->hasCredential('MANAGE_ADMIN') || $sf_user->hasCredential('MONTH_END_LOOP')  ) {?>
                   <li><a href="<?php echo url_for('function/CalcBeginMonth') ?>">Month-end Loop</a></li>
                   <?}?>
                </ul>                    
            </li>         
      </ul>
    </li>
    <!--ME NU APPROVAL-->
    <li class="submain" id="approval"><a class="asubmain" href="#" >APPROVAL</a>
                <ul id="subapprove">
                 <?php if ($sf_user->hasCredential('APPROVE_BOM') ) {?>   
                  <li><a href="<?php echo url_for('approval/ListApprovalObject?authenticationMain=APPROVE_BOM&authenticationSub=PR_APPROVE_BOM&mod=BOM&backURL=') ?>">Approval BOM</a></li>
                 <?}?>
		       
		 <?php if ($sf_user->hasCredential('APPROVE_MRSUBSTK') || $sf_user->hasCredential('APPROVE_MRSUBFTR')) {?>
                  <li><a href="<?php echo url_for('approval/ListApprovalObject?authenticationMain=APPROVE_MRSUBFTR&authenticationSub=APPROVE_MRSUBSTK&mod=MRSUB&backURL=') ?>">Approval MR Sub</a> </li>     
                  <?}?>		       
		 <?php if ($sf_user->hasCredential('APPROVE_MRRAW') ) {?>
                  <li><a href="<?php echo url_for('approval/ListApprovalObject?authenticationMain=APPROVE_MRRAW&authenticationSub=PR_APPROVE_MRRAW&mod=MRRAW&backURL=') ?>">Approval MR Raw</a></li>  
                  <?}?>
 	       <?php if ($sf_user->hasCredential('APPROVE_PO')  ) {?>
                  <li><a href="<?php echo url_for('approval/ListApprovalObject?authenticationMain=APPROVE_PO&authenticationSub=PR_APPROVE_PO&mod=PO&backURL=') ?>">Approval PO</a> </li> 
                <?}?>   
                </ul>
     </li>     
    <!--Ket thuc -->
     <!-- MENU CONFIG -->
    <li class="submain" id="config"><a class="asubmain" href="#" > CONFIG</a>
         <ul id="subconfig" >            
              <li>  <a href="<?php echo url_for('po/config') ?>">PO Template </a> </li> 
               <li>  <a href="<?php echo url_for('po/RateCurrencyConfig') ?>">Exchange Rate of Currency </a> </li>   
        </ul>
    </li>
    <!--MENU REPORT -->
    <li class="submain" id="report"><a class="asubmain" href="#" > REPORT</a>
         <ul id="subreport" >
            <li><a href="#">Inventory >></a>
                <ul>
                    <li><a href="<?php echo url_for('report/inventory') ?>">View</a></li>
                    <li><a href="<?php echo url_for('report/inventory?ExportToExcel=true') ?>">Export To Excel</a></li>
                </ul>
            </li>
            
            <li><a href="<?php echo url_for('report/project') ?>">Project</a> </li>        
            <li><a href="<?php echo url_for('report/provision') ?>">Provision</a></li>
            <li><a href="<?php echo url_for('report/tallyinOR?local=0') ?>">Oversea Receivable - Tally In</a></li>
            <li><a href="<?php echo url_for('report/tallyinOR?local=1') ?>">Local Receivable - Tally In</a> </li>        
            <li><a href="<?php echo url_for('report/tallyoutMat') ?>">Material Tally Out</a></li>
            <li><a href="<?php echo url_for('report/mrpoType') ?>">MR, PO Qty by Type</a></li>
            <li><a href="<?php echo url_for('report/valueLO') ?>">Local & Oversea Purchase </a> </li>  
            <li><a href="<?php echo url_for('report/valuePO') ?>">Purchase Value</a></li>   
           <li><a href="<?php echo url_for('report/ontimePO') ?>">Purchase  Ontime/Late Delivery</a></li>   
            
        </ul>
    </li>
      
     
</ul>


<script>
     // $("div#menu ul#nav li ul a").css("border","1px solid gray");
</script>

